# Macros for building, deleting

AS=tasm
ASFLAGS=/m

LINK=tlink
LINKEXE=/x
LINKCOM=/x /t

RM=del


# Rules to build files

.asm.obj:
	$(AS) $(ASFLAGS) $*
.obj.com:
	$(LINK) $(LINKCOM) $*
.obj.exe:
	$(LINK) $(LINKEXE) $*


# Targets:

all: ctmouse.exe ctm2exe.exe protocol.com

ctmouse.exe: ctmouse.obj ctm2exe.exe
	$(LINK) $(LINKCOM) $*,$*.exe
	ctm2exe $*.exe
ctm2exe.exe: ctm2exe.obj
protocol.com: protocol.obj

ctmouse.obj: ctmouse.asm ctm-en.msg
	copy ctm-en.msg ctmouse.msg>nul
	$(AS) $(ASFLAGS) $*
ctm2exe.obj: ctm2exe.asm
protocol.obj: protocol.asm

	
# Clean up:

clean:
	-$(RM) ctmouse.msg
	-$(RM) *.obj
